﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FightUIMgr : Singleton<FightUIMgr>
{
    //摇杆
    Joystick _joystick;
    //技能按钮
    //任务头像

    //与场景的点击交互
    TouchScenes _touchScenes;

    public void Init()
    {
        Debug.Log("FightUIMgr 初始化");
        if (_joystick == null)
        {
            _joystick = new Joystick();

            //_joystick.onMoveDir = onMove;
            //_joystick.onMoveEnd = onMoveEnd;
        }

        if (_touchScenes == null)
        {
            _touchScenes = new TouchScenes();
        }

    }

    internal void BindingJoystick(Action<Vector2> onJoystickMove, Action onJoystickMoveEnd)
    {
        _joystick.onMoveDir = onJoystickMove;
        _joystick.onMoveEnd = onJoystickMoveEnd;
    }

    private void onMoveEnd()
    {
        Debug.Log("移动结束");
    }

    private void onMove(Vector2 obj)
    {
        Debug.Log("移动方向：" + obj);
    }

    public void BindingTouchScene(Action<RaycastHit> onTouchSth)
    {
        _touchScenes.HitSthCallback = onTouchSth;
    }




}
